/********************************************************************
    copyright (c) by tnmujoy
    @created:	10/11/2011   15:11
    @filename: 	StrategyDemo
    @author:	Limiko Lau (limiko.lau@gmail.com)
    @brief:	    
*********************************************************************/

#ifndef DEMO_STRATEGYDEMO_H_
#define DEMO_STRATEGYDEMO_H_

#include <iostream>
#include "DesignPattern/Strategy.hxx"

class StrategyA
{
public:
    virtual void test() = 0;
};

class StrategyA1 : public StrategyA
{
public:
    virtual void test()
    {
        std::cout << "StrategyA1::test()\n";
    }
};

class StrategyA2 : public StrategyA
{
public:
    virtual void test()
    {
        std::cout << "StrategyA2::test()\n";
    }
};

class StrategyDemoA : public tnmujoy::gdut::StrategyContext<StrategyA>
{
public:
    void test()
    {
        strategy_->test();
    }
protected:
private:
};







class StrategyB
{
public:
    virtual void test() = 0;
};

class StrategyB1 : public StrategyB
{
public:
    virtual void test()
    {
        std::cout << "StrategyB1::test()\n";
    }
};
REGISTER_STRATEGY_CLASS(StrategyB, StrategyB1);

class StrategyB2 : public StrategyB
{
public:
    virtual void test()
    {
        std::cout << "StrategyB2::test()\n";
    }
};
REGISTER_STRATEGY_CLASS(StrategyB, StrategyB2);

class StrategyDemoB : public tnmujoy::gdut::StrategyContext<StrategyB>
{
public:
    void test()
    {
        strategy_->test();
    }
protected:
private:
};







class StrategyC
{
public:
    virtual void test() = 0;
};

class StrategyC1 : public StrategyC
{
public:
    virtual void test()
    {
        std::cout << "StrategyC1::test()\n";
    }
};
REGISTER_ALIAS_PRODUCT_CLASS(StrategyC, StrategyC1, "C1");

class StrategyC2 : public StrategyC
{
public:
    virtual void test()
    {
        std::cout << "StrategyC2::test()\n";
    }
};
REGISTER_ALIAS_PRODUCT_CLASS(StrategyC, StrategyC2, "C2");

class StrategyDemoC : public tnmujoy::gdut::StrategyContext<StrategyC>
{
public:
    void test()
    {
        strategy_->test();
    }
protected:
private:
};
#endif //DEMO_STRATEGYDEMO_H_

//
//History:
//[10/11/2011] <limiko.lau@gmail.com> created